Project Overview :

● A Taylor Series is an infinite series of mathematical terms that when summed together approximate a mathematical function.
● The goal of the Taylor series, is to create an estimate (guess) of what a function looks like by expanding it into an infinite set of terms.

Requirements :

● Python
● VS code

 
Code :
 

x=0.01 sum=0 for i in range(100): sum =sum+ pow(x,i) y=1/(1-x) print ("TAYLOR’S SERIES:\n", "x=", x, "\n", "y=",y, "\n" "sum=", sum)
 
Code Explanation :
 

● x=0.01 – Initialize x value as 0.01
● sum=0 – Initialize sum value as 0
● for i in range(100): – uses a for loop function to iterate the values within the defined range parameters
● sum =sum+ pow(x,i)
● Calculation: Here we consider x=0.01, sum=0, i=0{0 to 99}
● sum=0+(0.01 power 0), as we knew anything power 0 is 1
● so, sum = 0+1_-> sum = 1. returns the sum of all numbers from 0 to 99.
● y=1/(1-x)
● y=1/(1-0.01)-> y=1.01
● print ("TAYLOR’S SERIES:\n", "x=", x, "\n", "y=",y, "\n" "sum=", sum)
● Run the code.

 
Output :

●After running the code, output of the terminal as given below,




« Home

×